package service

import (
	"micro-grpc-server/library/wechat"
	"micro-grpc-server/services/wechat/internal/conf"
	"micro-grpc-server/services/wechat/internal/dao"
	"micro-grpc-server/services/wechat/internal/server"
)

type WechatService struct {
	conf  *conf.Config
	dao   *dao.WechatDao
	robot *wechat.RobotServer
}

func NewWechatService(config *conf.Config) (s *WechatService) {
	var wechatDao = dao.NewDao(config)
	s = &WechatService{
		conf:  config,
		dao:   wechatDao,
		robot: wechat.NewRobotServer(server.NewDefaultRobotHandler(wechatDao)),
	}
	return
}
